{% extends "base/base.html" %}
{% load i18n %}
{% comment %} Add a new company or a new candidate {% endcomment %}
{% block title %}{% trans 'Registrarse' %}{% endblock %}

{% block content %}

    <h3>{% trans 'Registre su empresa con nosotros' %}</h3>

    <div class="row-fluid">
        <div class="{% if not form.errors %}span6 offset3{% else %}span8 offset2{% endif %}">
        <hr>
            <form method="post" action="" class="form-horizontal">
                {% csrf_token %}
                {% comment %} Username {% endcomment %}
                <div class="control-group {% if form.username.errors %}info{% endif %}">
        {#            {% if form.username.errors %}#}
        {#                <p class="text-error">{{ form.username.errors.as_text }}</p>#}
        {#            {% endif %}#}
                    <label for="id_username" class="control-label">{% trans 'Usuario' %}</label>
                    <div class="controls">
                        <div class="input-append">
                            {{ form.username }}
                            <span class="add-on"><i class="icon-user"></i></span>
                        </div>
                        {% if form.username.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.username.errors }}</span>
                        {% endif %}
                    </div>
                </div>

                {% comment %} Password {% endcomment %}
                <div class="control-group {% if form.password1.errors or form.non_field_errors %}info{% endif %}">
                    <label for="id_password1" class="control-label">{% trans 'Contraseña' %}</label>
                    <div class="controls">
                        <div class="input-append">
                            {{ form.password1 }}
                            <span class="add-on"><i class="icon-lock"></i></span>
                        </div>
                        {% if form.password1.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.password1.errors }}</span>
                        {% endif %}
                        {% if form.non_field_errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.non_field_errors }}</span>
                        {% endif %}
                    </div>
                </div>
                <div class="control-group {% if form.password2.errors or form.non_field_errors %}info{% endif %}">
                    <label for="id_password2" class="control-label">{% trans 'Confirme su contraseña' %}</label>
                    <div class="controls">
                        <div class="input-append">
                            {{ form.password2 }}
                            <span class="add-on"><i class="icon-lock"></i></span>
                        </div>
                        {% if form.password2.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.password2.errors }}</span>
                        {% endif %}
                    </div>
                </div>

                {% comment %} First Name {% endcomment %}
                <div class="control-group {% if form.first_name.errors %}info{% endif %}">
                    <label for="id_first_name" class="control-label">{% trans 'Nombre(s)' %}</label>
                    <div class="controls">
                        {{ form.first_name }}
                        {% if form.first_name.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.first_name.errors }}</span>
                        {% endif %}
                    </div>
                </div>

                {% comment %} Last Name {% endcomment %}
                <div class="control-group {% if form.last_name.errors %}info{% endif %}">
                    <label for="id_last_name" class="control-label">{% trans 'Apellidos' %}</label>
                    <div class="controls">
                        {{ form.last_name }}
                        {% if form.last_name.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.last_name.errors }}</span>
                        {% endif %}
                    </div>
                </div>

                {% comment %} Email {% endcomment %}
                <div class="control-group {% if form.email.errors %}info{% endif %}">
                    <label for="id_email" class="control-label">E-mail</label>
                    <div class="controls">
                        <div class="input-append">
                            {{ form.email }}
                            <span class="add-on">@</span>
                        </div>
                        {% if form.email.errors %}
                            <span class="help-inline" style="padding-top: 5px;">{{ form.email.errors }}</span>
                        {% endif %}
                    </div>
                </div>
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary pull-right" style="width: 130px;">{% trans 'Registrar' %}</button>
                </div>
            </form>
        </div>
    </div>

{% endblock %}

{% comment %}
{% block content-related %}
<p>Fill out the form to the left (all fields are required), and your
account will be created; you'll be sent an email with instructions on how
to finish your registration.</p>

<p>We'll only use your email to send you signup instructions. We hate spam
as much as you do.</p>

<p>This account will let you log into the ticket tracker, claim tickets,
and be exempt from spam filtering.</p>
{% endblock %}
{% endcomment %}